<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
	<title>可用可信家庭市场</title>
	<!--                       CSS                       -->
	<!-- Reset Stylesheet -->
	<link rel="stylesheet" href="/static/css/reset.css" type="text/css" media="screen" />
	<!-- Main Stylesheet -->
	<link rel="stylesheet" href="/static/css/style.css" type="text/css" media="screen" />
	<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
	<link rel="stylesheet" href="/static/css/invalid.css" type="text/css" media="screen" />
	<!--                       Javascripts                       -->
	<!-- jQuery -->
	<script type="text/javascript" src="/static/scripts/jquery-1.3.2.min.js"></script>
	<!-- jQuery Configuration -->
	<script type="text/javascript" src="/static/scripts/simpla.jquery.configuration.js"></script>
	<!-- Facebox jQuery Plugin -->
	<script type="text/javascript" src="/static/scripts/facebox.js"></script>
	<!-- jQuery WYSIWYG Plugin -->
	<script type="text/javascript" src="/static/scripts/jquery.wysiwyg.js"></script>
	<!-- jQuery Datepicker Plugin -->
	<script type="text/javascript" src="/static/scripts/jquery.datePicker.js"></script>
	<script type="text/javascript" src="/static/scripts/jquery.date.js"></script>
	<!-- jQuery -->

    <script type="text/JavaScript" src="/static/date/WdatePicker.js" ></script>
	<!-- jQuery -->
	<link rel="stylesheet" type="text/css" media="all" href="/static/css/motai.css">
	<script type="text/javascript" src="/static/js/jquery-1.9.1.min.js"></script>
	<script type="text/javascript" charset="utf-8" src="/static/js/jquery.leanModal.min.js"></script>
	 <!-- 引入 ECharts 文件 -->
    <script src="/static/js/echarts.js"></script>
	<style>
		body{
			font-family:黑体;
		}
		 table {
            width:100%;
            height:300px;
            float:left;
            margin-left:10px;
            
        }
        .table3 {
            
            height:200px;
           
            
        }
        .table4 {
        	width:100%;
            height:400px;
           
        }
        table tr {
            border-width: 1px;
            padding: 8px;
            border-style: solid;
            border-color: #a9c6c9;
            background-color:#E0EEEE;
            font-size:15px;
        }
      
        .t1{
            background-color:#FFF8DC;
        }
        table.hovertable {
            font-family: verdana,arial,sans-serif;
            font-size:11px;
            color:#333333;
            border-width: 1px;
            border-color: #999999;
            border-collapse: collapse;
        }
        table.hovertable th {
            background-color:#c3dde0;
            border-width: 1px;
            padding: 8px;
            border-style: solid;
            border-color: #a9c6c9;
        }
        table.hovertable tr {
            background-color:#d4e3e5;
        }
        table.hovertable td {
            border-width: 1px;
            padding: 8px;
            border-style: solid;
            border-color: #a9c6c9;
            font-size:15px;
            line-height:20px;
        }
		.columndiv{
			font-size:12px;
			column-count:5;
			column-gap:2em;
			column-rule:2px dotted #43CD80;
		}
		.columndiv h4{
			column-span:all;
			text-align:center;
			background-color:#43CD80;
		}
	</style>
</head>
<body>
<div id="body-wrapper">
	<!-- Wrapper for the radial gradient background -->
	<div id="sidebar">
		<div id="sidebar-wrapper">

			<div id="profile-links">
				<!-- Logo (221px wide) -->
				<a href="#"><img id="logo" src="/static/images/logo.png" alt="Simpla Admin logo" /></a>

				{$_COOKIE['user_name']},你好 <br/>
				| <a href="/index.php/index/index/uexit" title="Sign Out">退出</a> </div>

			 <ul id="main-nav">
                <!-- Accordion Menu -->
                <!--<li> <a href="#/" class="nav-top-item no-submenu">-->
                    <!--&lt;!&ndash; Add the class "no-submenu" to menu items with no sub menu &ndash;&gt;-->
                    <!--Dashboard </a> </li>-->
                {if condition="!empty($powers['order_action'])"}
                <li> <a href="#" class="nav-top-item"> 订单操作</a>
                    <ul>
                    	
                        <li><a href="/index.php/index/index/neworder_list">新订单</a></li>
                        <!-- Add class "current" to sub menu items also -->
                        <li><a href="/index.php/index/index/addorder">创建新订单</a></li>
                        <li><a href="/index.php/index/index/allorder_list">所有订单</a></li>
                    </ul>
                </li>
           	{/if}
           	 {if condition="!empty($powers['cg_action'])"}
                <li> <a href="#" class="nav-top-item"> 采购单 </a>
                    <ul>
                        <li><a href="/index.php/index/index/newcg_list">待处理 采购单</a></li>
                        <li><a href="/index.php/index/index/cg_history">采购单历史</a></li>
                    </ul>
                </li>
             {/if}
              {if condition="!empty($powers['table_action'])"}
                <li> <a href="#" class="nav-top-item  current"> 报表 </a>
                    <ul>
                        <li><a href="/index.php/index/biao/daybiao">日报表</a></li>
                        <li><a  class="current" href="/index.php/index/biao/yuebiao">月报表</a></li>
                        <li><a  href="/index.php/index/biao/nianbiao">年报表</a></li>
                    </ul>
                </li>
               {/if}
                {if condition="!empty($powers['goods_action'])"}
                <li> <a href="#" class="nav-top-item">菜品管理 </a>
                    <ul>
                        <li><a href="/index.php/index/goods/goods">所有菜品</a></li>
                        <li><a href="/index.php/index/goods/categorys">所有分类</a></li>
                    </ul>
                </li>
                {/if}
                 {if condition="!empty($powers['promotion_action'])"}
                 <li> <a href="#" class="nav-top-item"> 推广活动 </a>
                    <ul>
                        <li><a href="/index.php/index/promotion/snlist">SN优惠码</a></li>
                    </ul>
                </li>
                {/if}
                <li> <a href="#" class="nav-top-item"> 个人信息 </a>
                    <ul>
                        <li><a href="/index.php/index/index/user_info">查看信息</a></li>
                        <li><a href="/index.php/index/index/update_pass">修改密码</a></li>
                    </ul>
                </li>
       
                {if condition="!empty($powers['super'])"}
                 <li><a href="#" class="nav-top-item"> 用户管理 </a>
                 	<ul>
                        <li><a href="/index.php/index/admin/user_admin">用户权限</a></li>
                    </ul>
                 </li>
                {/if}

            </ul>
            <!-- End #main-nav -->

		</div>
	</div>
	<!-- End #sidebar -->
	<div id="main-content">
		<div class="content-box" style="width:100%;float:left;height:500px;margin-top:-40px;">
			<!-- Start Content Box -->
				<div class="content-box-header" style="height:30px;"><br />
					<h5 style="margin-top:-10px;"><form action="/index.php/index/biao/yuebiao" method="post">
	                                &nbsp;数据统计：选择月份
	                                <input id="beginTime"  name="ps_date" value="" type="text" onfocus="WdatePicker({el:'beginTime',dateFmt:'yyyy/MM'});" class="Wdate" ></input>
	                                <button type="submit"  class="button medium back">查询</button>
	                            </form>
					</h5>
				</div>
				<!-- End .content-box-header -->
				<div class="content-box-content">
	
	                                <table class="hovertable table4">
	                                    <tr class="t1" style="height:20px;" onmouseover="this.style.backgroundColor='#b9df70';" onmouseout="this.style.backgroundColor='#d4e3e5';">
	                                        <td style="width:300px;">月份：{$day1str|date="Y-m-d",###}至{$day2str|date="Y-m-d",###}</td>
	                                    	<td style="width:300px;">店铺：{$store.name}</td>
	                                        <td>总单量：{$yallcount}</td>
	                                    </tr>
	
	                                    <tr class="t1" style="height:200px;"onmouseover="this.style.backgroundColor='#b9df70';" onmouseout="this.style.backgroundColor='#d4e3e5';">
	                                        <td  colspan="3">
	                                        	<div class="columndiv" >
	                                        		<h4>新增客户：{$yu} 个</h4>
	                                        		<p>
	                                        			{volist name="ynew_user" id="u"}
	                                           				 {$u}<br/>
	                                           			{/volist}
	                                        		</p>
	                                        	</div>
	                                       
	                                        </td>
	                                    </tr>
	                                    <tr class="t1" style="height:20px;"onmouseover="this.style.backgroundColor='#b9df70';" onmouseout="this.style.backgroundColor='#d4e3e5';">
	                                        <td colspan="3">总销售额：{$yallsum['sum(discount_price)']} （元）</td>
	                                    </tr>
	                                </table>   
	                                
				</div>
	             
			<!-- End .content-box-content -->
		</div>
			<!-- End .content-box -->
					<div class="content-box" style="width:100%;float:left;height:1600px;margin-top:-10px;">
			<!-- Start Content Box -->
			<div class="content-box-header" style="height:30px;"><br />
				<h5 style="margin-top:-5px;">&nbsp;月报表</h5>
			</div>
			<!-- End .content-box-header -->
						<div class="content-box-content">
									<div style="width:100%;height:450px;background-color:#D4D4D4;">
										<div id="main" style="width:95%;height:400px;"> </div>
	<script type="text/javascript">
									    
	// 基于准备好的dom，初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));																	    
option = {
    tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
        }
    },
    legend: {
        data: ['总单量','老用户', '新用户']
    },
    grid: {
        left: '1%',
        right: '1%',
        bottom: '3%',
        containLabel: true
    },
    yAxis:  {
        type: 'value'
    },
    xAxis: {
        type: 'category',
        data: [
        			{volist name="alldays" id="s"}
		                	{$s},
		            {/volist} 
        ]
    },
    series: [
    	{
          name:"总单量",
          type:"line",
          data:[
          		{volist name="daysale" id="s"}
	                	{$s},
	            {/volist} 
          ],
           //绘制平均线
           itemStyle : { 
           		normal: {
           			label : {
           				show: true,
           			}
           		}
           		
           },
			
		},
        {
            name: '老用户',
            type: 'bar',
            stack: '总量',
            label: {
                normal: {
                    show: true,
                    position: 'insideRight'
                }
                
            },
            data: [
	           		 {volist name="day_oldsale" id="o"}
		                	{$o},
		            {/volist}
	                ]
        },
       {
            name: '新用户',
            type: 'bar',
            stack: '总量',  
            label: {
                normal: {
                    show: true,
                    position: 'insideRight'
                }
            },
            data: [
	                {volist name="day_newsale" id="n"}
	                	{$n},
	                {/volist}
				]
       },	
       
    ]
};
myChart.setOption(option);
	</script>	
									</div>
									<div style="width:100%;height:350px;background-color:#FCFCFC;">
											<div id="main5" style="width:100%;height:300px;"> </div>
<script type="text/javascript">
// 基于准备好的dom，初始化echarts实例
var myChart = echarts.init(document.getElementById('main5'));
option = {
    title: {
        text: '新用户增长图',
    },
    tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
        },
        formatter: function (params) {
            var tar;
            if (params[1].value != '-') {
                tar = params[1];
            }
            else {
                tar = params[0];
            }
            return tar.name + '<br/>' + tar.seriesName + ' : ' + tar.value;
        }
    },
    legend: {
        data:['新用户增长图']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis: {
        type : 'category',
        splitLine: {show:false},
        data: [
       {volist name="alldays" id="s"}
		                	{$s},
		            {/volist}
        ]
    },
    yAxis: {
        type : 'value'
    },
   series: [
        {
            name: '新用户增长图',
            type: 'bar',
            stack: '总量',
            label: {
                normal: {
                    show: true,
                    position: 'top'
                }
            },
            data: [
            	{volist name="day_newsale" id="n"}
	                	{$n},
	            {/volist}
            ]
        },
        
    ]
};
myChart.setOption(option);
	</script>	
									</div>
												
									
										<div style="width:100%;height:330px;background-color:#D4D4D4;">
											<div id="main3" style="width:100%;height:330px;"> </div>
 
 <script type="text/javascript">
									    
	// 基于准备好的dom，初始化echarts实例
var myChart = echarts.init(document.getElementById('main3'));		
var xAxisData = [];
{volist name="goods10" id="n"}
	              xAxisData.push('{$n.name}');
{/volist}
option = {
    tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
        }
    },
    legend: {
        data: ['热门菜品前17个']
    },
    grid: {
        left: '1%',
        right: '1%',
        bottom: '3%',
        containLabel: true
    },
    yAxis:  {
        type: 'value'
    },
    xAxis: {
        type: 'category',
        data: xAxisData,
    },
    series: [
       {
            name: '热门菜品前17个',
            type: 'bar',
            stack: '总量',  
            label: {
                normal: {
                    show: true,
                    position: 'insideRight'
                }
            },
            data: [
	                {volist name="goods10" id="s"}
		                	{$s.num},
		            {/volist} 
				]
       },	
       
    ]
};
myChart.setOption(option);
	</script>	
										</div>
										
										<div style="width:100%;height:350px;background-color:#FCFCFC;">
										<div id="main2" style="width:100%;height:300px;"> </div>
 
	<script type="text/javascript">	
var myChart = echarts.init(document.getElementById('main2'));

option = {
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b}: {c} ({d}%)"
    },
    legend: {
        orient: 'vertical',
        x: 'left',
        data:['男','女','线上支付','线下支付']
    },
    series: [
        {
            name:'占比例',
            type:'pie',
            selectedMode: 'single',
            radius: [0, '30%'],

            label: {
                normal: {
                    position: 'inner'
                }
            },
            labelLine: {
                normal: {
                    show: false
                }
            },
            data:[
                {value:{$sex['woman']}, name:'女', selected:true},
                {value:{$sex['man']}, name:'男'},
            ]
        },
        {
            name:'支付方式',
            type:'pie',
            radius: ['40%', '55%'],

            data:[
                {value:{$pay_type['offline']}, name:'线下支付'},
                {value:{$pay_type['weixin']}, name:'线上支付'},
            ]
        }
    ]
};
myChart.setOption(option);
	</script>
									</div>
					<!-- End .content-box-content -->
					
					</div>
			<!-- End .content-box -->


	</div>
	<!-- End #main-content -->
	
	
</div>

<script>
	function printPage(k,key,ps_date)
	{
		var bdhtml=window.document.body.innerHTML;//获取当前页面html代码
		var sprnstr= "<!--startprint"+k+"-->" ;
		var eprnstr= "<!--endprint"+k+"-->" ;
		var prnhtml=bdhtml.substring(bdhtml.indexOf(sprnstr)+18);
		prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
		window.document.body.innerHTML=prnhtml;
		window.print();
		window.document.body.innerHTML=bdhtml;
		$('#reids_date').val(ps_date);
		$('#reids_time').val(key);
	}


	message_tips();
	/**
	 * ajax提醒
	 **/
	a = 1;
	function fn(){

		if(a == 1){
			$('#message_tips').css({color:'white'});
			$('#message_tips2').css({color:'white'});
			a = 0;
		}else{
			$('#message_tips').css({color:'#F00'});
			$('#message_tips2').css({color:'#F00'});
			a = 1;
		}
	}
	var myInterval;
	function message_tips(){
		$.get("/index.php/index/index/tips", function(data){
			if(data != $('#message_tips').html()){
				$('#message_tips').css({color:'#F00'});
				myInterval = setInterval(fn,5000);
				$('#message_tips2').css({color:'#F00'});
				$("#message_audio").html("<audio id='ttsoundplayer'  autoplay='autoplay'><source src='/static/sound/1583.wav' type='audio/wav'></audio>");

			} else {
				$("#message_audio").html('');
				if(data == 0){
					$('#message_tips').css({color:'#000'});
					clearInterval(myInterval);
				}
			}

			$('#message_tips').html(data);
			$('#message_tips2').html(data);
		},'json');
		setTimeout('message_tips()',10000);
	}



</script>

<!-- won模态框（Modal） -->
<div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-1" style="display:none;">
	<div class="am-modal-dialog">
		<div class="am-modal-hd">是否打印成功？
			<a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
		</div>
		<div class="am-modal-bd">
			打印成功后，此页面将不再显示该采购表<br/><br/>
			<form method="post" action="/index.php/index/index/printcg_success">
				<input type="hidden" name="ps_date" value="" id="reids_date"/>
				<input type="hidden" name="ps_time" value="" id="reids_time"/>
				<button type="submit" class="submit btn btn-primary">
					确定已打印
				</button>
			</form>
		</div>
	</div>
</div>
<!-- won模态框（Modal） -->
</body>
</html>
